package com.bwie.gateway.globController;

import com.bwie.common.result.Result;
import com.bwie.gateway.globAdvice.GlobalExecption;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GlobControllerAdvice{

    /**
     * 全局异常处理
     * @param e
     * @return
     */
    @ExceptionHandler(value = GlobalExecption.class)
    public Result error(GlobalExecption e){
        return Result.error(e.getMessage());
    }
}
